<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户列表-thymeleaf</title>
</head>
<body>
<table border="1" cellspacing="0">
    <tr >
        <th>编号</th>
        <th>姓名</th>
        <th>工资</th>
        <th>入职日期</th>
        <th>性别</th>
    </tr>
    <!--th:each="遍历的对象:${后台属性名}"表示遍历-->
    <tr th:each="user:${pageInfo.list}">
        <!--th:text表示取值，并且将值显示在双标签中间-->

        <td th:text="${user.id}"></td>
        <td th:text="${user.ename}"></td>
        <td th:text="${user.salary}"></td>
        <td th:text="${user.hiredate}"></td>
        <td th:text="${user.sex}"></td>
        <!--表单元素使用th:value表示取值，并且将值显示出来-->
        <!--<input type="text" name="ename" th:value="${user.ename}">-->
    </tr>

</table>
<div>
    <a th:if="${pageInfo.hasPreviousPage}" th:href="@{selectUserList.do(pageNum=${pageInfo.pageNum}-1)}">上一页</a>&emsp;
    <a th:if="${pageInfo.hasNextPage}" th:href="@{selectUserList.do(pageNum=${pageInfo.pageNum}+1)}">下一页</a>
    &emsp;&emsp;
    <a th:each="page_num:${pageInfo.getNavigatepageNums()}" th:if="${pageInfo.pageNum}==page_num" th:href="@{#}" th:text="${page_num}"></a>
    &emsp;&emsp;
    <a th:each="page_num:${pageInfo.getNavigatepageNums()}" th:if="${pageInfo.pageNum}!=page_num" th:href="@{selectUserList.do(pageNum=${page_num})}" th:text="${page_num}"></a>
    <br>
</div>
</body>
</html>